#include<stdio.h>

int getx(char* chx,char* getchx,int index)
{
    int i=0;
    while (getchx[i]!='\n')
    {
        chx[index++]=getchx[i++];
    }
    return index;
}

void main()
{
    char buff[255];
    char buch2[20];
    int x=0;
    FILE* f=fopen("./ax1.txt","r");
    fgets(buff,255,f);

    x=getx(buch2,buff,x);
    printf("%s",buff);
    fgets(buff,255,f);
    x=getx(buch2,buff,x);
    printf("%s",buff);
    
    fgets(buff,255,f);
    x=getx(buch2,buff,x);
    printf("%s",buff);

    buch2[x]='\0';
    printf("%d\n",x);
    printf("%s",buch2);

    

    fclose(f);
}